package com.note7_9;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

import com.note7_6.Person;

public class Question4 {

	/*
	 * 百度,ByteArrayInputStream和ByteArrayOutputStream的用法和案例
	 */
	public static void main(String[] args) throws IOException {
		Person p = new Person();
		//直接获得文件序列化后的字节
		ByteArrayOutputStream bis = new ByteArrayOutputStream();
		ObjectOutputStream oout = new ObjectOutputStream(bis);
		oout.writeObject(p);
		byte[] b = bis.toByteArray();
		for(byte bs:b)
			System.out.println(bs);
	}
}
